<link isdevelop rel="stylesheet" href="../../../statics/css/style.css"  type="text/css" />
<link isdevelop rel="stylesheet" href="../../../statics/css/common.css"  type="text/css" />
<div id="index_main">
    <{getDiyValue  language_id=$language_id name=diy_home_sale_num_discount}>
    <{if $diy_home_sale_num_discount}>
    <{include file="common/salenumdiscount.htm"}>
    <{/if}>
    <div id="bannerbox">
        <div id="banner">
            <{include file="common/index_banner.htm"}>
        </div>
    </div>
    <div class="banbox">
        <{getDiyValue language_id=$language_id name=diy_banner_ads1 print=1}>
        <{getDiyValue language_id=$language_id name=diy_banner_ads2 print=1}>
    </div>
    <div class="clear"></div>
    <{getDiyValue language_id=$language_id name=diy_index_tag1}>
    <{getDiyValue language_id=$language_id name=diy_index_tag1_num}>
    <div id="right_box">
        <div class="rightbox">
            <div class="boxtitle"><h3><a href="/Narrow/t<{$diy_index_tag1}>/list-r1.html"><span><{getTagName language_id=$language_id tag_id=$diy_index_tag1}></span></a></h3></div>
            <div class="boxcon">
                <ul class="products">
                    <{goodsList item=rows tag_id=$diy_index_tag1 language_id=$language_id limit=$diy_index_tag1_num name=diy_index_tag1}>
                    <li>
                        <a href="<{url  ctl_name='product_url' goods_id=$rows.id product_id=$rows.product_id language_id=$language_id rewrite_type=$rewrite_type res=$rows}>" class="pic"><img src="<{$rows.image|image:'160x140'}>" alt="<{$rows.base_name}>" /></a>
                        <a href="<{url  ctl_name='product_url' goods_id=$rows.id product_id=$rows.product_id language_id=$language_id rewrite_type=$rewrite_type res=$rows}>" class="name"><{$rows.base_name|truncate:'40'}></a>
                        <div class="price">Price: <strong><{$lcoin}> <{$rows.price|price}><{$rcoin}></strong></div>
                        <{if $rows.market_price > $rows.price}>
                        <span class="discount"><{math equation="(x - y / z)*b" x=1 y=$rows.price z=$rows.market_price b=100 format="%.0f"}></span>
                        <{/if}>
                    </li>
                    <{if $goodsList.diy_index_tag1.iteration mod 5 eq 0 || $goodsList.diy_index_tag1.last}>
                    <li class="other"></li>
                    <{/if}>
                    <{/goodsList}>
                </ul>
            </div>
        </div>
        <div class="clear"></div>
        <{getDiyValue language_id=$language_id name=diy_home_center_banner_disp}>
        <{if $diy_home_center_banner_disp}>
        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="logobox">
            <{brandList key=keybrand item=rows language_id=$language_id  limit=12 name=rs_brandlist}>
            <{if $brandList.rs_brandlist.first}>
            <tr>
                <{/if}>
                <td>
                    <a title="<{$rows.base_name}>" href="<{url  ctl_name='brand_url' brand_id=$rows.id  language_id=$language_id rewrite_type=$rewrite_type res=$rows}>" class="">
                        <img src="<{$rows.image|image:'158x78'}>" />
                    </a>
                </td>
                <{if $brandList.rs_brandlist.iteration mod 6 eq 0}>
            </tr><tr>
                <{/if}>
                <{if $brandList.last}>
            </tr>
            <{/if}>
            <{/brandList}>
        </table>
        <div class="clear"></div>
        <{/if}>
        <{getDiyValue language_id=$language_id name=diy_timing_buying_id}>
        <{dev_getSOAttr soid = $diy_timing_buying_id}>
        <{if $soa.status == 1}>
        <div class="rightbox">
            <div class="boxtitle">
                <div class="fr timebox lxftime_single" endtime="<{$soa.end_time}>000">
                </div>
                <h3>
                    <span><{$soa.base_name}></span>
                </h3>
            </div>
            <div class="boxcon">
                <ul class="products">
                    <{getDiyValue language_id=$language_id name=diy_timing_buying_num}>
                    <{dev_getSOGoods soid=$diy_timing_buying_id item=rows language_id=$language_id limit=$diy_timing_buying_num name=diytimingbuying}>
                    <li lang="<{$salegoodsList.diytimingbuying.iteration}>">
                        <a href="<{url ctl_name='product_url' goods_id=$rows.id product_id=$rows.product_id language_id=$language_id rewrite_type=$rewrite_type res=$rows}>" class="pic"><img src="<{$rows.image|image:'160x140'}>" alt="<{$rows.base_name}>" /> </a>
                        <a href="<{url ctl_name='product_url' goods_id=$rows.id product_id=$rows.product_id language_id=$language_id rewrite_type=$rewrite_type res=$rows}>" class="name"><{$rows.base_name|truncate:'40'}> </a>
                        <div class="price">Price: <strong><{$lcoin}><{$rows.price|price}><{$rcoin}></strong></div>
                        <span class="lxftime time" endtime="<{$rows.end_time}>000"></span>
                    </li>
                    <{if $dev_getSOGoods.diytimingbuying.iteration mod 5 eq 0 || $salegoodsList.diytimingbuying.last}>
                    <li class="other"></li>
                    <{/if}>
                    <{/dev_getSOGoods}>
                </ul>
            </div>
        </div>
        <{/if}>
        <div class="boxban">
            <{getDiyValue language_id=$language_id name=diy_index_ads1 print=1}><{getDiyValue language_id=$language_id name=diy_index_ads2 print=1}><{getDiyValue language_id=$language_id name=diy_index_ads3 print=1}>
        </div>
        <{getDiyValue language_id=$language_id name=diy_index_tag2}>
        <{getDiyValue language_id=$language_id name=diy_index_tag2_num}>
        <{getDiyValue language_id=$language_id name=diy_index_tag3}>
        <{getDiyValue language_id=$language_id name=diy_index_tag3_num}>
        <div class="rightbox">
            <ul class="boxtitle protitle">
                <li class="protit_a_l"><a href="/Narrow/t<{$diy_index_tag2}>/list-r1.html" class="cur"><{getTagName language_id=$language_id tag_id=$diy_index_tag2}></a></li>
                <li><a href="/Narrow/t<{$diy_index_tag3}>/list-r1.html"><{getTagName language_id=$language_id tag_id=$diy_index_tag3}></a></li>
            </ul>
            <div class="boxcon productbox">
                <ul class="products" style="display:block;">
                    <{goodsList item=rows tag_id=$diy_index_tag2 language_id=$language_id limit=$diy_index_tag2_num name=diy_index_tag2}>
                    <li>
                        <a href="<{url  ctl_name='product_url' goods_id=$rows.id product_id=$rows.product_id language_id=$language_id rewrite_type=$rewrite_type res=$rows}>" class="pic"><img src="<{$rows.image|image:'160x140'}>" alt="<{$rows.base_name}>" /></a>
                        <a href="<{url  ctl_name='product_url' goods_id=$rows.id product_id=$rows.product_id language_id=$language_id rewrite_type=$rewrite_type res=$rows}>" class="name"><{$rows.base_name|truncate:'40'}></a>
                        <div class="price">Price: <strong><{$lcoin}> <{$rows.price|price}><{$rcoin}></strong></div>
                        <p class="reviewstar">
                            <span class="star star-s<{math equation="x / y" x=$rows.comment_value y=$rows.comment_counts format='%.0f'}>"></span>
                            </p>
                        </li>
                        <{if $goodsList.diy_index_tag2.iteration mod 5 eq 0 || $goodsList.diy_index_tag2.last}>
                        <li class="other"></li>
                        <{/if}>
                        <{/goodsList}>
                    </ul>
                    <ul class="products">
                        <{goodsList item=rows tag_id=$diy_index_tag3 language_id=$language_id limit=$diy_index_tag3_num name=diy_index_tag3}>
                        <li>
                            <a href="<{url  ctl_name='product_url' goods_id=$rows.id product_id=$rows.product_id language_id=$language_id rewrite_type=$rewrite_type res=$rows}>" class="pic"><img src="<{$rows.image|image:'160x140'}>" alt="<{$rows.base_name}>" /></a>
                            <a href="<{url  ctl_name='product_url' goods_id=$rows.id product_id=$rows.product_id language_id=$language_id rewrite_type=$rewrite_type res=$rows}>" class="name"><{$rows.base_name|truncate:'40'}></a>
                            <div class="price">Price: <strong><{$lcoin}> <{$rows.price|price}><{$rcoin}></strong></div>
                            <p class="reviewstar">
                                <span class="star star-s<{math equation="x / y" x=$rows.comment_value y=$rows.comment_counts format='%.0f'}>"></span>
                                </p>
                            </li>
                            <{if $goodsList.diy_index_tag3.iteration mod 5 eq 0 || $goodsList.diy_index_tag3.last}>
                            <li class="other"></li>
                            <{/if}>
                            <{/goodsList}>
                        </ul>
                    </div>
                </div>
            </div><!--#right_box-->
        </div><!--#index_main-->


        <script type="text/javascript">
            $(function() {
                $(".protitle>li").hover(function() {
                    $(".protitle a").removeClass("cur");
                    $(this).addClass("cur");
                    $(".productbox>ul").hide();
                    var i = $(this).index();
                    $(".productbox>ul").eq(i).show();
                });
            });
        </script>









        <script>
            function lxfEndtime() {
                $(".lxftime").each(function() {
                    //alert(parseInt($(this).attr("endtime")))
                    var lxfday = $(this).attr("lxfday");//��4�ж��Ƿ���ʾ����ı�
                    var endtime = new Date(parseInt($(this).attr("endtime"))).getTime();//ȡ��������(����ֵ)
                    var nowtime = new Date().getTime();//���������(����ֵ)
                    var youtime = endtime - nowtime;//���ж��(����ֵ)
                    var seconds = youtime / 1000;
                    var minutes = Math.floor(seconds / 60);
                    var hours = Math.floor(minutes / 60);
                    var days = Math.floor(hours / 24);
                    var CDay = days;
                    var CHour = hours % 24;
                    var CMinute = minutes % 60;
                    var CSecond = Math.floor(seconds % 60);//"%"��ȡ�����㣬�������Ϊ60��һ��ȡ����Ȼ��ֻҪ����
                    if (endtime <= nowtime) {
                        $(this).html("<span>" + 0 + "</span><em> </em><span>" + "00" + "</span><em>:</em><span>" + "00" + "</span><em>:</em><span>" + "00" + "</span><em></em>")//����������С�ڵ�ǰ���ھ���ʾ����2
                    } else {
                        if ($(this).attr("lxfday") == "no") {
                            $(this).html("<span>" + CHour + "</span>ʱ<span>" + CMinute + "</span>��<span>" + CSecond + "</span>��");          //���û����������
                        } else {
                            $(this).html("" + days + "<sub>day</sub><span>" + CHour + "</span>:<span>" + CMinute + "</span>:<span>" + CSecond + "</span>");          //�������������
                        }
                    }
                });
                setTimeout("lxfEndtime()", 1000);
            }
            ;
            //单独的
            function lxfEndtime_single() {
                $(".lxftime_single").each(function() {
                    var lxfday = $(this).attr("lxfday");
                    var endtime = new Date(parseInt($(this).attr("endtime"))).getTime();
                    var nowtime = new Date().getTime();
                    var youtime = endtime - nowtime;
                    var seconds = youtime / 1000;
                    var minutes = Math.floor(seconds / 60);
                    var hours = Math.floor(minutes / 60);
                    var days = Math.floor(hours / 24);
                    var CDay = days;
                    var CHour = hours % 24;
                    var CMinute = minutes % 60;
                    var CSecond = Math.floor(seconds % 60);
                    if (endtime <= nowtime) {
                        $(this).html("<span>" + 0 + "</span><em> </em><span>" + "00" + "</span><em>:</em><span>" + "00" + "</span><em>:</em><span>" + "00" + "</span><em></em>")
                    } else {
                        if ($(this).attr("lxfday") == "no") {
                            $(this).html("<span>" + CHour + "</span>ʱ<span>" + CMinute + "</span>��<span>" + CSecond + "</span>��");
                        } else {
                            $(this).html("<span class='day_d'>" + days + "</span><span class='time_h'>" + CHour + "</span><span class='time_m'>" + CMinute + "</span><span class='time_s'>" + CSecond + "</span>");
                        }
                    }
                });
                setTimeout("lxfEndtime_single()", 1000);
            }
            ;
            $(function() {
                lxfEndtime();
                lxfEndtime_single();
            });
        </script>



